<%--
  Created by IntelliJ IDEA.
  User: kezs
  Date: 2017/10/12
  Time: 15:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加文章</title>
    <link rel="stylesheet" type="text/css" href="../static/admin/Css/identify.css" />
    <link rel="stylesheet" type="text/css" href="../static/admin/Css/layout.css" />

    <link rel="stylesheet" type="text/css" href="../static/admin/Css/style.css" />
    <link rel="stylesheet" type="text/css" href="../static/admin/Css/control_index.css" />
    <script type="text/javascript" src="../static/admin/Js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../static/admin/Js/layer.js"></script>
    <script type="text/javascript" src="../static/admin/Js/haidao.offcial.general.js"></script>
    <script type="text/javascript" src="../static/admin/Js/select.js"></script>
    <script type="text/javascript" src="../static/admin/Js/haidao.validate.js"></script>

    <style type="text/css">
        .addArticle {
            width: 60%
        }

        .addArticle td {
            border: 1px solid #ada5a5;
        }
    </style>

    <script type="text/javascript" charset="utf-8" src="../static/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../static/ueditor/ueditor.all.min.js"></script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="../static/ueditor/lang/zh-cn/zh-cn.js"></script>

    <!-- 实例化编辑器 -->
    <script type="text/javascript">
        var editor = UE.getEditor('container');
    </script>
</head>

<body>
<%@include file="topbar.jsp" %>
<div class="view-body">
    <%@include file="slidebar.jsp" %>
    <div class="view-product background-color">
        <div class="padding-big background-color">


            <!--添加文章-->
            <div>
                <form action="/backend/add" method="post">
                    <table class="addArticle">
                        <tr>
                            <td>title</td>
                            <td><input type="text" name="title"></td>
                        </tr>

                        <tr>
                            <td>author</td>
                            <td><input type="text" name="author"></td>
                        </tr>

                        <tr>
                            <td>remark</td>
                            <td><input type="text" name="remark"></td>
                        </tr>



                        <tr>
                            <td>keyword</td>
                            <td><input type="text" name="keyword" value=""></td>
                        </tr>

                        <tr>
                            <td>clickCount</td>
                            <td><input type="text" name="clickCount" value="0"></td>
                        </tr>

                        <tr>
                            <td>reClickCount</td>
                            <td><input type="text" name="realClickCount" value="0"></td>
                        </tr>

                        <tr>
                            <td>replyCount</td>
                            <td><input type="text" name="replyCount" value="0"></td>
                        </tr>

                        <tr>
                            <td>categoryId</td>
                            <td>
                                <input type="text" id="categoryName" name="categoryName"/>
                                <select name="categoryId" id="categoryId">
                                    <c:forEach items="${categories}" var="category">
                                        <option value="${category.id}">${category.categoryName}</option>
                                    </c:forEach>
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td>status</td>
                            <td>
                             <select name="status">
                                 <option value="1">可用</option>
                                 <option value="2">不可用</option>
                             </select>
                            </td>
                        </tr>

                        <tr>
                            <td>picUrl</td>
                            <td><input type="text" name="picUrl"></td>
                        </tr>
                        <tr>
                            <td>recommId</td>
                            <td>
                                <select name="recommId">
                                    <option value="1">普通</option>
                                    <option value="2">首页推荐</option>
                                    <option value="3">热门</option>
                                    <option value="4">加new</option>
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td colspan="2">
                                <!-- 加载编辑器的容器 -->
                                <script id="container" name="content" type="text/plain">
                                    这里写你的初始化内容
                                </script>
                            </td>
                        </tr>

                        <tr>
                            <td colspan="2">
                                <input type="submit" value="提交">
                            </td>
                        </tr>


                    </table>

                </form>

            </div>
        </div>
    </div>
</div>

</body>


<script language="JavaScript">
    $("#categoryId").change(function () {
        var selectText = $("#categoryId").find("option:selected").text();
        $("#categoryName").val(selectText);
    })
</script>

</html>
